A comment is descriptive text that you insert in HTML code to explain the document's code or to provide other information. A comment does not affect the appearance of the document in a browser.
See also Invisible Elements preferences.
To insert a comment:
1 | Place the cursor where you want the comment. |
2 | Click the Comment button on the Objects palette or choose Insert > Comment. |
![]() |
To display comment markers in the Document window, choose View > Invisible Elements.
To enter comment text:
1 | Select the Comments icon. |
2 | Enter text in the Property inspector. |
![]() |
Creating a comment generates the following HTML code:
<!-- Comment text.-->
Note: Dreamweaver adds a space after the comment characters, like this: <!--(space).
In some cases this can interfere with server-side include
and exec
commands. For example, if you enter # include virtual = "/js/door:js/"
in the comment fields the include would not work. To work around this condition, you can change the object file for comments so that it doesn't add a space after <!--. See Creating a new object.